/*    file: main.cpp
 *    desc:
 * 
 * created: 2016-04-06
 *  author: chuanjiang.zh@qq.com
 * company: 
 */

#include <stdio.h>
#include <iostream>
#include <assert.h>
#include <errno.h>
#include <memory>
#include <deque>

#include "BasicType.h"
#include "SharedPtr.h"
#include "TFileUtil.h"
#include "TByteBuffer.h"
#include "BasicMacro.h"
#include "TStringUtil.h"


#include "DateTime.h"
#include "Path.h"
#include "TimePoint.h"
#include "TRandom.h"

#include "MPlayer.h"




class Application
{
public:

public:
	Application()
	{
		MDecode_Init();
	}

	~Application()
	{

		MDecode_Uninit();
	}


public:
	MPlayer	m_player;

};


int main(int argc, char** argv)
{
	std::string filename = "rtsp://admin:sjld16301@192.168.3.65/";
	//filename = "f:\\media\\love.mp4";

	if (argc > 1)
	{
		filename = argv[1];
	}

	Application app;

	//MDecode_EnableHwAccel(true);

	app.m_player.open(filename);
	app.m_player.play();

	while (true)
	{
		std::cout << "$";

		std::string line;
		std::getline(std::cin, line);
		if (line == "q")
		{
			break;
		}
	}

	app.m_player.stop();
	app.m_player.close();

	return 0;
}




